<html>
<head>
<title>My test editor - with tinyMCE and PHP</title>
<script language="javascript" type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
  tinyMCE.init({
    theme : "advanced",
    mode: "exact",
    elements : "elm1",
    theme_advanced_toolbar_location : "top",
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,"
    + "justifyleft,justifycenter,justifyright,justifyfull,formatselect,"
    + "bullist,numlist,outdent,indent",
    theme_advanced_buttons2 : "link,unlink,anchor,image,separator,"
    +"undo,redo,cleanup,code,separator,sub,sup,charmap",
    theme_advanced_buttons3 : "",
    height:"350px",
    width:"650px"
});

</script>
</head>
<?php $this->load->helper('HTML');
echo link_tag('css/style2.css');
echo link_tag('images/favicon.ico','shortcut icon','image/x-icon');
?>
<body>
<div id="page1">
<div id="wrapper">
	<hr />

		<div id="wrapper">
			<?php $this->load->view('admin_views/header'); ?>
		</div>

		<!-- end #menu -->
		<!--<div id="search">
			<form method="get" action="">
				<fieldset>
				<input type="text" name="s" id="search-text" size="15" />
				<input type="submit" id="search-submit" value="GO" />
				</fieldset>
			</form>
		</div>-->
        
		<!-- end #search -->
	</div>
<div id="page">
	<div id="page-bgtop">
		<div id="content">
		<div id="info">
			<div class="post">
			    <div >
				<?php
// Should use some proper HTML filtering here.
$session_id = $this->session->userdata('privilege');
if ($session_id=='1') {

		
			//foreach($dealer as $m) : 
			if(count($pesan->result_array())>0)
	    {
	        foreach($pesan->result_array() as $h)
	        {
            //   echo ' <h2 class="title">INFO PERUBAHAN PROGRAM</h2>';
					echo $h['pesan'];
					$abu=$h['pesan'];
		}
		}
   echo ' <h2 class="title">Edit Tutorial Di Bawah Ini</h2>';
    echo  '<form method="post" action="kajedugbenjol/edit">';

echo  '<textarea id="elm1" name="elm1" rows="15" cols="80"> '.$abu.' </textarea>';	
    echo  '<input type="submit" name="save" value="Submit" />';
    echo  '<input type="reset" name="reset" value="Reset" />';
    echo  '</form>';
	
echo ' <h2 class="title">Ini utk Upload Image</h2>';
echo  '<form method="post" action="kajedugbenjol/gambar" enctype="multipart/form-data">';
echo  '<input type="file" id="poto" name="poto" size="40" />';
echo  '<input type="submit" name="upload" value="Upload" />';
echo  '</form>';
echo'<div id="gallery">';
   
        foreach($images as $img){
    
//echo'    <div class="thumb">';
echo'    <a href='.$img['url'].' >';
echo'    <img src='.$img['url'].' alt="" />';
echo'</a><br>'.$img['namafile'] ;    
echo anchor ('kajedugbenjol/delete/'.$img['namafile'], 'Hapus', array('onClick' =>"return confirm ('Apakah Anda yakin akan menghapus data ')"));
echo '<br> Ini Linknya untuk tutorial &gt; images/info/'.$img['namafile'];
//echo' </div>';
}
echo' </div>';
	
} else {

if(count($pesan->result_array())>0)
	    {
	        foreach($pesan->result_array() as $h)
	        {
	 //              echo ' <h2 class="title">INFO PERUBAHAN PROGRAM</h2>';
					echo $h['pesan'];
					if ($h['pesan']==''){redirect('home/index');}
		}
		}
  } 		

?>
				</div>
			</div>
		</div>
		</div>
		<?php $this->load->view('admin_views/sidebar'); ?>
		<!-- end #content -->
	  <div style="clear: both;">&nbsp;</div>
	</div>
	</div>
	</div>
		<div id="footer-bgcontent">
	<?php $this->load->view('admin_views/footer'); ?>
	</div>

	<!-- end #page -->
</div>

</body>
</html>

